package com.csjbot.blackgaga.model.tcp.proxy;

import android.content.Context;

import com.csjbot.blackgaga.model.tcp.factory.ServerFactory;
import com.csjbot.blackgaga.model.tcp.tts.ISpeak;
import com.csjbot.coshandler.listener.OnSpeakListener;

/**
 * Created by jingwc on 2017/9/21.
 */

public class SpeakProxy implements ISpeak{

    private static class SpeakHolder{
        private static final  SpeakProxy INSTANCE = new SpeakProxy();
    }

    public static final SpeakProxy getInstance(){
        return SpeakHolder.INSTANCE;
    }

    public ISpeak speak;

    private SpeakProxy(){
        speak = ServerFactory.getSpeakInstance();
    }

    @Override
    public void startSpeaking(String text, OnSpeakListener listener) {
        speak.startSpeaking(text,listener);
    }

    @Override
    public void stopSpeaking() {
        speak.stopSpeaking();
    }

    @Override
    public void pauseSpeaking() {
        speak.pauseSpeaking();
    }

    @Override
    public void resumeSpeaking() {
        speak.resumeSpeaking();
    }

    @Override
    public boolean isSpeaking() {
        return speak.isSpeaking();
    }

    @Override
    public void initSpeak(Context context) {
        speak.initSpeak(context);
    }
}
